<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/modules/cms/front/include/taglib.jsp" %>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>店铺身份信息管理</title>
    <meta name="decorator" content="default"/>
    <link href="${ctxStatic}/merchant/css/layui.css" rel="stylesheet" type="text/css">
    <link href="${ctxStatic}/merchant/css/index.css" rel="stylesheet" type="text/css">
    <link href="${ctxStatic}/merchant/css/register1.css" rel="stylesheet" type="text/css">
    <link href="${ctxStatic}/merchant/css/register4.css" rel="stylesheet" type="text/css">
    <script type="text/javascript">
        $(document).ready(function () {
            $("input[type='checkbox']").change(function () {
                if ($("input[type='checkbox']").is(':checked')) {
                    $("#btnSubmit").css('background-color', '#ef593c');
                    $("#btnSubmit").removeAttr('disabled');
                } else {
                    $("#btnSubmit").css('background-color', '#ccc');
                    $("#btnSubmit").attr('disabled', 'true');
                }
            });


            //$("#name").focus();
            $("#inputForm").validate({
                submitHandler: function (form) {
                    var PWD_REGEXP = /^(?=.*[0-9])(?=.*[a-zA-Z])(.{8,20})$/;
                    var shopPassword = $("#shopPassword").val();
                    var reShopPassword = $("#reShopPassword").val();
                    if (PWD_REGEXP.test(shopPassword) || PWD_REGEXP.test(reShopPassword)) {
                        if (shopPassword != reShopPassword) {
                            $.jBox.alert("两次输入的密码不一致，请重新输入");
                            return false;
                        } else {
                            loading('正在跳转，请稍等...');
                            form.submit();
                        }
                    } else {
                        $.jBox.alert("请输入8~20个字符，包含大小写字母、数字");
                        return false;
                    }

                },
                errorContainer: "#messageBox",
                errorPlacement: function (error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
        });

    </script>
</head>
<body>
<header>
    <div class="register-title">
        <span>商户入驻</span>
    </div>
</header>
<form:form id="inputForm" modelAttribute="hkUserShopEnter" action="${ctx}/userShopEnter" method="post">
    <form:hidden path="id"/>
    <sys:message content="${message}"/>

    <div class="content">
        <div class="manager-info">
            <span class="title">店铺管理人基本信息<i class="warntitle">带*号为必填项</i></span>
            <div class="info">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>店铺管理人姓名：</label>
                    <div class="layui-input-block">
                        <form:input path="managerName" id="managerName" htmlEscape="false"
                                    style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                                    lay-verify="required" placeholder="请输入管理人姓名" autocomplete="off"
                                    class="layui-input required" value="${hkUserShopEnter.managerName}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>店铺管理人邮箱：</label>
                    <div class="layui-input-block">
                        <form:input path="managerEmail" htmlEscape="false" type="text"
                                    style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                                    lay-verify="required" placeholder="请输入常用邮箱，便于信息及时送达  " autocomplete="off"
                                    class="layui-input required" value="${hkUserShopEnter.managerEmail}"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>店铺管理人手机：</label>
                    <div class="layui-input-block">
                        <form:input path="managerMobile" htmlEscape="false" type="text"
                                    value='<%=request.getSession().getAttribute("loginName")%>'
                                    style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                                    lay-verify="required" placeholder="请输入手机号，后期可更改" readonly="true" autocomplete="off"
                                    class="layui-input"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>店铺管理人身份证件人像面：</label>
                    <div class="layui-input-block">
                        <div class="photo">
                                <%--<input type="hidden" id="cardPersonImgSrc" name="cardPersonImgSrc"/>--%>
                            <form:hidden id="cardPersonImgSrc" path="cardPersonImgSrc" htmlEscape="false"
                                         maxlength="200" class="input-xlarge"/>
                            <sys:ckfinder input="cardPersonImgSrc" type="thumb" uploadPath="/shop/card"
                                          selectMultiple="false"/>
                        </div>
                        <div class="sfz"></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>店铺管理人身份证件国徽面：</label>
                    <div class="layui-input-block">
                        <div class="photo">
                                <%--<input type="hidden" id="cardCountryImgSrc" name="cardCountryImgSrc"/>--%>
                            <form:hidden id="cardCountryImgSrc" path="cardCountryImgSrc" htmlEscape="false"
                                         maxlength="200" class="input-xlarge"/>
                            <sys:ckfinder input="cardCountryImgSrc" type="thumb" uploadPath="/shop/card"
                                          selectMultiple="false"/>
                        </div>
                        <div class="sfz2"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="store-info store">
            <span class="title">店铺基本信息<i class="warntitle">带*号为必填项</i></span>
            <div class="info">

                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>店铺名称：</label>
                    <div class="layui-input-block">
                        <form:input path="name" htmlEscape="false" type="text" name="address"
                                    style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                                    lay-verify="required" placeholder="请输入店铺名称"
                                    autocomplete="off" class="layui-input required" value="${hkUserShopEnter.name}"/>
                        <span>入驻后店铺名称不可修改，请谨慎填写</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><sppan style="color:red;">*</sppan>店铺Logo：</label>
                    <div class="layui-input-block">
                        <div>
                            <form:hidden id="imgSrc" path="imgSrc" htmlEscape="false"
                                         maxlength="200" class="input-xlarge"/>
                            <sys:ckfinder input="imgSrc" type="images" uploadPath="/shop/logo"
                                          selectMultiple="false"/>
                        </div>
                            <%--<div class="sfz"></div>--%>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>主营类目：</label>
                    <div class="layui-input-block">
                        <sys:treeselect id="categoryId" name="category.id" labelName="category.name"
                                        labelValue="${hkUserShopEnter.category.name}"
                                        value="${hkUserShopEnter.category.id}"
                                        title="类目" url="/shop/category/hkShopCategory/merchTreeData" cssClass=""/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>登录账号：</label>
                    <div class="layui-input-block">
                        <form:input type="text" path="username" name="address"
                               style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                               lay-verify="required" value='<%=request.getSession().getAttribute("loginName")%>'
                               class="layui-input" readonly="true" placeholder="请输入手机号，后期可更改"
                               autocomplete="off"/>
                        <span>该登录账号为商家后台账号，请牢记</span>
                    </div>
                </div>
                <label class="layui-form-label"><span style="color:red;">*</span>设置密码：</label>
                <div class="layui-input-block">
                    <form:password path="shopPassword" id="shopPassword" htmlEscape="false"
                                   style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                                   autocomplete="off"
                                   placeholder="请输入密码"
                                   class="layui-input required"/>
                    <span>8~20个字，包含大小写字母、数字</span>
                </div>

                <div class="layui-form-item"></div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>确认密码：</label>
                    <div class="layui-input-block">
                        <input type="password" id="reShopPassword" name="reShopPassword"
                               style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                               lay-verify="required" placeholder="请再次输入密码"
                               autocomplete="off" class="layui-input required"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <input type="checkbox" name="" title="我已阅读并同意" lay-skin="primary"/>
                <span>我已阅读并同意</span>
                <a class="agreement" onclick="window.open('${fns:getFrontPath()}/open')"
                   target="_blank">《乐小转商家合作入驻协议》</a>
            </div>
            <i style="margin-left: 270px; font-style: inherit;color: #CC9966;">点击确认后，代表您已签订并同意《乐小转商家入驻合作协议》</i>
        </div>
        <div class="next">
            <input id="btnSubmit" type="submit" value="提交">
        </div>
    </div>
    <footer class="foot">
		<span>
			Copyright 2017-2018 lexiaozhuan.com 版权所有 (京ICP证030173号
		</span>
        <img src="${ctxStatic}/merchant/images/shouye/ghs.png">
        <span>
			京公网安备11000002000001号)
		</span>
    </footer>
</form:form>

</body>

<script src="${ctxStatic}/merchant/js/layui.all.js"></script>
</html>
